package com.sky.mapper.admin;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    /**
     * 向菜品表插入数据
     *
     * @param dish
     * @return
     */
    @AutoFill(OperationType.INSERT)
    int insert(Dish dish);

    /**
     * 菜品分页查询
     *
     * @param page
     * @param queryDTO
     * @return
     */
    Page<DishVO> pageQuery(Page<DishVO> page,@Param("queryDTO") DishPageQueryDTO queryDTO);


    /**
     * 修改菜品
     *
     * @param dish
     */
    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);


}
